bitkeeper revision 1.1238 (421f5ff99YUDAfj5D9rbZseED1YYVA)
authorrneugeba@wyvis.research.intel-research.net <rneugeba@wyvis.research.intel-research.net>
Fri, 25 Feb 2005 17:27:21 +0000 (17:27 +0000)
committerrneugeba@wyvis.research.intel-research.net <rneugeba@wyvis.research.intel-research.net>
Fri, 25 Feb 2005 17:27:21 +0000 (17:27 +0000)
added performance counters for hypercalls and exceptions

Signed-off-by: michael.fetterman@cl.cam.ac.uk
xen/arch/x86/x86_32/asm-offsets.c
xen/arch/x86/x86_32/entry.S
xen/common/perfc.c
xen/include/xen/perfc_defn.h

index 839893b793751d29a121042ccaaeb9f584673267..4a609826a1e6801d8c7ef7dda962667ecacbd5bf 100644 (file)
@@ -68,4 +68,7 @@ void __dummy__(void)
     BLANK();
 
     DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
+
+    OFFSET(PERFC_hypercalls, struct perfcounter_t, hypercalls);
+    OFFSET(PERFC_exceptions, struct perfcounter_t, exceptions);
 }
index b47edf86f86eb26ea1c76a32cfd0a45eb95a3f42..f1fa6df104a2dbc808339578639e3b2700c518b5 100644 (file)
@@ -60,7 +60,7 @@
 #include <asm/apicdef.h>
 #include <asm/page.h>
 #include <public/xen.h>
-
+        
 #define GET_CURRENT(reg)         \
         movl $STACK_SIZE-4, reg; \
         orl  %esp, reg;          \
@@ -278,8 +278,11 @@ ENTRY(hypercall)
         subl $4,%esp
        SAVE_ALL(b)
         sti
+#ifdef PERF_COUNTERS
+        lock incl SYMBOL_NAME(perfcounters)+PERFC_hypercalls(,%eax,4)
+#endif
         GET_CURRENT(%ebx)
-       andl $(NR_hypercalls-1),%eax
+        andl $(NR_hypercalls-1),%eax
        call *SYMBOL_NAME(hypercall_table)(,%eax,4)
         movl %eax,XREGS_eax(%esp)       # save the return value
 
@@ -466,6 +469,9 @@ error_code:
         movw  XREGS_entry_vector(%esp),%ax
         movl  %esp,%edx
        pushl %edx                      # push the xen_regs pointer
+#ifdef PERF_COUNTERS
+        lock incl SYMBOL_NAME(perfcounters)+PERFC_exceptions(,%eax,4)
+#endif        
        GET_CURRENT(%ebx)
        call  *SYMBOL_NAME(exception_table)(,%eax,4)
         addl  $4,%esp
index 4a5c1708506f7c20a62244d8765408cbd35dfd04..61dd983ea293a93d8a26690a1382059f699ee95a 100644 (file)
@@ -66,7 +66,7 @@ void perfc_printall(unsigned char key)
         case TYPE_S_ARRAY:
             for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
                 sum += atomic_read(&counters[j]);
-            printk("TOTAL[%10d]\n ", sum);
+            printk("TOTAL[%10d]  ", sum);
             for ( j = 0; j < perfc_info[i].nr_elements; j++ )
             {
                 printk("A%02d[%10d]  ", j, atomic_read(&counters[j]));
index 18db383a2c6997bdcc97deaf658c02ab850edf1b..ff9d4a22432587ef271bb46ee8ec39c79f87d57d 100644 (file)
@@ -41,6 +41,8 @@ PERFCOUNTER_CPU( check_all_pagetables, "calls to check_all_pagetables" )
 PERFCOUNTER_ARRAY( wpt_updates, "writable pt updates", PERFC_MAX_PT_UPDATES )
 PERFCOUNTER_ARRAY( bpt_updates, "batched pt updates", PERFC_MAX_PT_UPDATES )
 
+PERFCOUNTER_ARRAY( hypercalls, "hypercalls", NR_hypercalls )
+PERFCOUNTER_ARRAY( exceptions, "exceptions", 32 ) /* XXX constant */
 
 #define VMX_PERF_EXIT_REASON_SIZE 37
 #define VMX_PERF_VECTOR_SIZE 0x20